{	Problem: http://codeforces.ru/problemset/problem/82/B
	Verdict: Accepted
}
ype
  dp=-1000..4000;

var 
    i,j,x,k,n,cc,h,c,good,sm,m,kk:longint;
    b,f:array[dp] of boolean;
    a,tk:array[dp] of int64;
    ts:array[dp,dp] of boolean;
        r:array[dp,dp] of int64;
        g:boolean;
        
begin  
fillchar(b,sizeof(b),false);
fillchar(ts,sizeof(ts),false);
fillchar(f,sizeof(f),false);
fillchar(r,sizeof(r),0);
read(n);
k:=n*(n-1) div 2;
cc:=0;
for i:=1 to k do begin
    read(tk[i]);
    for j:=1 to tk[i] do begin
        read(x);
        if not b[x] then begin
            b[x]:=true;
            inc(cc);
            a[cc]:=x;
            f[x]:=true;
        end;
        ts[i][x]:=true;
    end;
end;
h:=1;
c:=1;
kk:=cc;
good:=n-1;
while c<=n do begin 
    while (not f[a[h]]) and (h<=kk) do inc(h);  
    r[c][0]:=1;
    r[c][1]:=a[h];
    f[a[h]]:=false;
    a[h]:=0;
    dec(cc);
    for i:=1 to kk do begin
        if f[a[i]] then begin
            g:=true;
            sm:=0;
            for j:=1 to k do begin
                for m:=1 to r[c][0] do
                    if (((not ts[j][r[c][m]]) and ts[j][a[i]]) or (ts[j][r[c][m]] and (not ts[j][a[i]])))  then begin
                        g:=false;
                        break;
                    end else
                    if ts[j][r[c][m]] and ts[j][a[i]] then inc(sm);
                if not g then break;            
            end;
            if not g then continue;
            if ((sm div r[c][0]=good) and (cc>n-c)) or (sm=0) then begin
                inc(r[c][0]);
                r[c][r[c][0]]:=a[i];
                f[a[i]]:=false;
                a[i]:=0;
                dec(cc);
            end;
        end;
    end;
    inc(c);     
end;
for i:=1 to n do begin
    write(r[i][0],' ');
    for j:=1 to r[i][0] do write(r[i][j],' ');
    writeln;
end;
end.